import requests
from tools import config
from tools.RsaClass import rsaclass


sUserName = 'xianfeng.yu'
Headers = config.headers
sDomain = config.sDomain
sTime = config.sTime
sSourceStr = "account_name=" + sUserName + "&domain=" + sDomain + "&time=" + sTime

# 数字签名
sSign = rsaclass(sSourceStr)

# 封装参数
param = {
    "account_name": sUserName,
    "domain": sDomain,
    "time": sTime,
    "sign": sSign,
}

resp = requests.get(url="https://cm.qiye.163.com/oaserver/user/getUnreadMsg", params=param, headers=Headers)
# print(resp.request.url)
print(resp.text)